'''
@project:pythonProjectT174
@auther:zhongyingjie
@file:tinyshop_elements.py
@date:2022/11/7 15:04
@desc:
'''
from selenium.webdriver.common.by import By

# input_kw={'element_locator':By.ID,'element_value':'kw'}
# click_baidu= {'element_locator':By.ID,'element_value':'su'}
#
# click_xw={'element_locator':By.LINK_TEXT,'element_value':'新闻'}
# click_hao123={'element_locator':By.LINK_TEXT,'element_value':'hao123'}
# click_tb={'element_locator':By.LINK_TEXT,'element_value':'贴吧'}

# click_dljm={'element_locator':By.XPATH,'element_value':'//a[text()="登录"]'}
#前台登录
click_dlym={'element_locator':By.XPATH,'element_value':'//a[text()="登录"]'}
input_yhm={'element_locator':By.ID,'element_value':'account'}
input_mima={'element_locator':By.NAME,'element_value':'password'}
click_dl={'element_locator':By.XPATH,'element_value':'//button[text()="登录"]'}

# 后台登录
input_htzh = {'element_locator':By.NAME,
            'element_value':'name'}
input_htmm = {'element_locator':By.NAME,
            'element_value':'password'}
input_htyz = {'element_locator':By.NAME,
            'element_value':'verifyCode'}
click_htdl={'element_locator':By.CLASS_NAME,
            'element_value':'button'}

#购物
input_ss={'element_locator':By.ID,'element_value':'search-keyword'}
click_ss={'element_locator':By.XPATH,'element_value':'//button[text()="搜索"]'}
click_sp={'element_locator':By.XPATH,'element_value':'//*[@id="main"]/div[2]/div/div/div[2]/dl/dd/ul/li[1]/dl/dt/a/img'}
click_ys={'element_locator':By.XPATH,'element_value':'//*[@id="product-intro"]/div[3]/div/dl[1]/dd/ul/li[1]/span'}
click_cm={'element_locator':By.XPATH,'element_value':'//*[@id="product-intro"]/div[3]/div/dl[2]/dd/ul/li[1]/span'}
click_jrgwc={'element_locator':By.XPATH,'element_value':'//span[text()="加入购物车"]'}
click_gwc={'element_locator':By.ID,'element_value':'shopping-cart'}
click_gwcjs={'element_locator':By.XPATH,'element_value':'//a[text()="去购物车结算"]'}
click_ljjs={'element_locator':By.XPATH,'element_value':'//a[text()="立即结算"]'}
click_tjdd={'element_locator':By.XPATH,'element_value':'//*[@id="main"]/div[2]/div/form/div[6]/p/input'}
click_ljzf={'element_locator':By.XPATH,'element_value':'//*[@id="main"]/div[2]/form/div[3]/p/input'}
click_ljgm={'element_locator':By.XPATH,'element_value':'//*[@id="buy-now"]/span'}

#添加商品
click_spzx={'element_locator':By.LINK_TEXT,
            'element_value':'商品中心'}
click_tj={'element_locator':By.CLASS_NAME,
            'element_value':'icon-plus'}
click_fl={'element_locator':By.ID,
            'element_value':'category_id'}
click_fl1={'element_locator':By.CSS_SELECTOR,
            'element_value':'select#category_id option:nth-child(9)'}
input_mc={'element_locator':By.NAME,
            'element_value':'name'}
input_bh={'element_locator':By.NAME,
            'element_value':'goods_no'}
click_qhkj={'element_locator':By.CSS_SELECTOR,
            'element_value':'.button.select_button'}
i_frame={'element_locator':By.NAME,
            'element_value':'Openupimg_dialog'}
click_tk={'element_locator':By.XPATH,
            'element_value':'//li[text()="图库图片"]'}
click_xztp={'element_locator':By.XPATH,
            'element_value':'//img[@src="/tinyshop/data/uploads/2014/04/29/4e7afbf5508fb11769950c397b67c03b.png"]'}
click_tjtp={'element_locator':By.CLASS_NAME,
            'element_value':'button'}
input_gg1 = {'element_locator':By.XPATH,
            'element_value':'//*[@id="goods_list"]/table/thead/tr[1]/td[2]/input'}
input_gg2 = {'element_locator':By.NAME,
            'element_value':'store_nums'}
input_gg3 = {'element_locator':By.NAME,
            'element_value':'sell_price'}
input_gg4 = {'element_locator':By.NAME,
            'element_value':'market_price'}
input_gg5 = {'element_locator':By.NAME,
            'element_value':'cost_price'}
click_tijiao={'element_locator':By.CLASS_NAME,
            'element_value':'focus_button'}

#添加客户
click_khzx={'element_locator':By.XPATH,
            'element_value':'//a[text()="客户中心"]'}
click_tjyhan={'element_locator':By.XPATH,
            'element_value':'//*[@id="content"]/form/div/a[3]'}
input_tjyhm={'element_locator':By.XPATH,
            'element_value':'//input[@pattern="required"]'}
input_tjmm={'element_locator':By.XPATH,
            'element_value':'//input[@pattern="\w{6,}"]'}
input_tjqrmm={'element_locator':By.NAME,
            'element_value':'repassword'}
input_tjyx={'element_locator':By.NAME,
            'element_value':'email'}
input_tjzxxm={'element_locator':By.NAME,
            'element_value':'real_name'}
input_tjsr={'element_locator':By.NAME,
            'element_value':'birthday'}
select_shen={'element_locator':By.XPATH,
            'element_value':'//select[@id="province"]'}
select_shi={'element_locator':By.XPATH,
            'element_value':'//select[@id="city"]'}
select_xian={'element_locator':By.XPATH,
            'element_value':'//select[@id="county"]'}
click_tjyhsq={'element_locator':By.XPATH,
            'element_value':'//input[@value="提交"]'}


#代金券模块元素
click_yxtg={'element_locator':By.LINK_TEXT,'element_value':'营销推广'}
click_djjmb={'element_locator':By.LINK_TEXT,'element_value':'代金券模板'}
click_tjdjj= {'element_locator':By.CLASS_NAME,'element_value':'icon-plus'}# 点击添加
input_djjname={'element_locator':By.NAME,'element_value':'name'} # 输入代金券名称
input_mz={'element_locator':By.NAME,'element_value':'value'} # 输入面值
input_xfje={'element_locator':By.NAME,'element_value':'money'} # 输入消费金额
input_jf={'element_locator':By.NAME,'element_value':'point'} # 输入正常数值积分
click_djjtj= {'element_locator':By.XPATH,'element_value':'/html/body/div[2]/div[2]/div/form/div/input[1]'}# 点击提交

#点击处理按钮
click_CL={'element_locator':By.CSS_SELECTOR,
          'element_value':'#content > form > table > tbody > tr:nth-child(2) > td.btn_min > div > a'}
#编辑代金券
click_bjdjj={'element_locator':By.CLASS_NAME,'element_value':'icon-pencil'}
#创建代金券
click_cjdjj={'element_locator':By.XPATH,
             'element_value':'//*[@id="content"]/form/table/tbody/tr[2]/td[2]/div/div/ul/li[1]/a'}
input_starttime={'element_locator':By.NAME,'element_value':'start_time'} # 输入开始时间
click_kongbai={'element_locator':By.CLASS_NAME,'element_value':'aui_content'} # 点击空白处
input_endtime={'element_locator':By.NAME,'element_value':'end_time'}  # 输入结束时间
input_num={'element_locator':By.ID,'element_value':'voucher_num'} # 输入张数
# 点击生成
click_sc={'element_locator':By.XPATH,'element_value':'//*[@id="export_form"]/div/button'}
#删除代金券模板
click_dele={'element_locator':By.XPATH,
           'element_value':'//*[@id="content"]/form/table/tbody/tr[2]/td[2]/div/div/ul/li[3]/a'} #删除
click_deqr={'element_locator':By.CLASS_NAME,'element_value': 'aui_state_highlight'}#确认
#发货
click_ddzx={'aa':By.LINK_TEXT,'bb':'订单中心'} #订单中心
click_ddcl={'aa':By.XPATH,'bb':'//*[@id="content"]/form/table/tbody/tr[2]/td[2]/div/a'}#处理
click_ddcl2={'aa':By.XPATH,'bb':'//*[@id="content"]/form/table/tbody/tr[3]/td[2]/div/a'}
click_fh={'aa':By.CLASS_NAME,'bb':'icon-truck'}#点发货
click_frme={'aa':By.CSS_SELECTOR,
            'bb':'iframe[name="Opensend_dialog"]'} #框架
input_dh={'aa':By.NAME,'bb':'express_no'}#单号
click_djfh={'aa':By.XPATH,'bb':'/html/body/div/form/div/button'} #发货


#添加地址
action_center={'element_locator':By.XPATH,'element_value':'//*[@id="header"]/div[1]/div/div[2]/ul/li[1]/a'}
click_sh={'element_locator':By.XPATH,'element_value':'//*[@id="header"]/div[1]/div/div[2]/ul/li[1]/div/ul/li[6]/a'}
click_ao={'element_locator':By.ID,'element_value':'address_other'}
i_frame1={'element_locator':By.XPATH,'element_value':'//iframe[starts-with(@name,"OpenartDialog")]'}
click_zip1={'element_locator':By.XPATH,'element_value':'//option[@value=430000]'}
click_zip2={'element_locator':By.XPATH,'element_value':'//option[@value=430100]'}
click_zip3={'element_locator':By.XPATH,'element_value':'//option[@value=430105]'}
input_zip={'element_locator':By.NAME,'element_value':'zip'}
input_addr={'element_locator':By.NAME,'element_value':'addr'}
input_an={'element_locator':By.NAME,'element_value':'accept_name'}
input_mobile={'element_locator':By.NAME,'element_value':'mobile'}
input_phone={'element_locator':By.NAME,'element_value':'phone'}
click_dz={'element_locator':By.XPATH,'element_value':'//input[@class="btn"]'}